package work4List;
import java.util.ArrayList;
import java.util.List;

public class PersonTest {
    public static void main(String[] args) {
        List<Person> list=new ArrayList<>();
        personList.add(new Person("张三",1,18));
        personList.add(new Person("李四",2,19));
        for(Person person:personList){
            System.out.println("[{姓名:"+person.getName()+",ID:"+person.getId()+",年龄:"+person.getAge()+"]}");
        }

    }
}
